package com.yc;

public class Basic {

    // ThreadLocal<T>
    public static ThreadLocal<Long> x = new ThreadLocal<Long>(){
        @Override
        protected Long initialValue() {
            System.out.println("Initial Value run...");
            return 100L;
//            return Thread.currentThread().getId();
        }
    };

    public static void main(String[] args) {
        new Thread() {
            @Override
            public void run() {
                System.out.println(x.get());
            }
        }.start();


        x.set(101L);
        System.out.println(x.get());
    }
}
